//
//  ForumTableViewCell.m
//  CarHome
//
//  Created by 小伍 on 14-9-18.
//  Copyright (c) 2014年 WJN_work@163.com. All rights reserved.
//

#import "ForumTableViewCell.h"

@implementation ForumTableViewCell
- (void)dealloc
{
    [_image release];
    _image = nil;
    [_labelLeftDown release];
    _labelLeftDown = nil;
    [_labelLeftUp release];
    _labelLeftUp = nil;
    [super dealloc];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
         UIColor * color = [UIColor colorWithWhite:0.1 alpha:0.2];
        //右侧图片
        _image = [[UIImageView alloc]initWithFrame:CGRectZero];
        
        [self.contentView addSubview:_image];
        //左上侧
        _labelLeftUp = [[UILabel alloc]initWithFrame:CGRectZero];
        
        _labelLeftUp.layer.cornerRadius = 4;
        [_labelLeftUp.layer setBackgroundColor:color.CGColor];
        [_labelLeftUp setTextColor:[UIColor blackColor]];
        _labelLeftUp.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_labelLeftUp];
        //左下侧
        _labelLeftDown = [[UILabel alloc]initWithFrame:CGRectZero];
        [_labelLeftDown setTextColor:[UIColor redColor]];
        [self.contentView addSubview:_labelLeftDown];
        _labelLeftUp.numberOfLines = 0;
        _labelLeftDown.numberOfLines = 0;
        _labelLeftDown.font = [UIFont systemFontOfSize:14];
        _labelLeftDown.layer.cornerRadius = 4;
        [_labelLeftDown.layer setBackgroundColor:color.CGColor];
        _labelLeftDown.textAlignment = NSTextAlignmentCenter;
        _labelLeftUp.textAlignment = NSTextAlignmentCenter;
        //分割线

        UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(5, 105, 110, 1)];

        [label setBackgroundColor:[UIColor redColor]];
        [self.contentView addSubview:label];
    }
    return self;
}
- (void)layoutSubviews
{
    _image.frame = CGRectMake(120, 5, 200, 150);
    _labelLeftUp.frame = CGRectMake(5, 5, 110, 95);
    _labelLeftDown.frame = CGRectMake(5, 110, 110, 40);
    
    [super layoutSubviews];
}
- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
